<html lang="java">
<head>
    <title>123</title>
    <script type="text/javascript">
        window.onload = function () {
            var  submit=  document.getElementById("submit");

            var  dName=  document.getElementById("dName");
            var  sdName=  document.getElementById("sdName");
            dName.onblur = checkdName;
            function  checkdName(){
                return   check(dName,sdName,"部门名称");
            }
            var  dDesc=  document.getElementById("dDesc");
            var  sdDesc=  document.getElementById("sdDesc");
            dName.onblur = checkdDesc;
            function  checkdDesc(){
                return   check(dDesc,sdDesc,"公司描述");
            }


            function  check(view,s,text){
                var value = view.value ;
                if(value==null ||value=="" ){
                    s.innerHTML=text+"不能为空";
                    view.focus();
                    return  false;
                }
                else{
                    s.innerHTML="";
                    return true;
                }
            }

            submit.onclick = function () {
                if (checkdName() && checkdDesc()){
                    return  true;
                }
                return  false;
            }
        }
    </script>
    <style type="text/css">
        span{
            color:red ;
        }
    </style>
    <style type="text/css">
        body
        {
            background-size: 100% 100%;
            height: 100%;
            width: 100%;
            text-align: center;
            margin-top: 50px;
            margin-left: auto;
        }
        table{
            text-align: center;
            margin: auto;
            text-decoration-color: #E3E6EB;
        }
        h1{
            font-size: 35px;
            color: #5d5a8b;
        }
    </style>
</head>
<body background="/static/img/26.jpeg" >
<#--<body background="/static/img/Q4.jpg" >-->
<h1>添加部门</h1>
<form action="/record/insertdep.do" method="post">
    <table cellpadding="4" cellspacing="1" >
        <tr>
            <td>部门名称：</td>
            <td><input type="text" placeholder="人事部" name="dName" id="dName"/><span id="sdName"></span></td>
        </tr>
        <tr>
            <td>公司描述：</td>
            <td><textarea name="dDesc"  id="dDesc"></textarea> <span id="sdDesc"></span></td>
        </tr>
        <tr>
            <td colspan="2" style="text-align: center">
                <input type="submit" value="添加" id="submit"> &nbsp;&nbsp;<input type="button" value="返回"  onclick="location.href='/record/departmentlist.html'">
            </td>
        </tr>
    </table>
</form>

</body>
</html>